home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Programming / gcc-2.95.3-3 / info / g77.info-5 < prev    next >
Encoding:
GNU Info File  |  2001-07-15  |  50.5 KB  |  1,290 lines

  1. This is Info file f/g77.info, produced by Makeinfo version 1.68 from
  2. the input file ./f/g77.texi.
  3.  
  4. INFO-DIR-SECTION Programming
  5. START-INFO-DIR-ENTRY
  6. * g77: (g77).                  The GNU Fortran compiler.
  7. END-INFO-DIR-ENTRY
  8.    This file documents the use and the internals of the GNU Fortran
  9. (`g77') compiler.  It corresponds to the GCC-2.95 version of `g77'.
  10.  
  11.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  12. Boston, MA 02111-1307 USA
  13.  
  14.    Copyright (C) 1995-1999 Free Software Foundation, Inc.
  15.  
  16.    Permission is granted to make and distribute verbatim copies of this
  17. manual provided the copyright notice and this permission notice are
  18. preserved on all copies.
  19.  
  20.    Permission is granted to copy and distribute modified versions of
  21. this manual under the conditions for verbatim copying, provided also
  22. that the sections entitled "GNU General Public License," "Funding for
  23. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  24. included exactly as in the original, and provided that the entire
  25. resulting derived work is distributed under the terms of a permission
  26. notice identical to this one.
  27.  
  28.    Permission is granted to copy and distribute translations of this
  29. manual into another language, under the above conditions for modified
  30. versions, except that the sections entitled "GNU General Public
  31. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  32. `Look And Feel'", and this permission notice, may be included in
  33. translations approved by the Free Software Foundation instead of in the
  34. original English.
  35.  
  36.    Contributed by James Craig Burley (<craig@jcb-sc.com>).  Inspired by
  37. a first pass at translating `g77-0.5.16/f/DOC' that was contributed to
  38. Craig by David Ronis (<ronis@onsager.chem.mcgill.ca>).
  39.  
  40. 
  41. File: g77.info,  Node: Changes,  Next: Language,  Prev: News,  Up: Top
  42.  
  43. User-visible Changes
  44. ********************
  45.  
  46.    This chapter describes changes to `g77' that are visible to the
  47. programmers who actually write and maintain Fortran code they compile
  48. with `g77'.  Information on changes to installation procedures, changes
  49. to the documentation, and bug fixes is not provided here, unless it is
  50. likely to affect how users use `g77'.  *Note News About GNU Fortran:
  51. News, for information on such changes to `g77'.
  52.  
  53.    Note that two variants of `g77' are tracked below.  The `egcs'
  54. variant is described vis-a-vis previous versions of `egcs' and/or an
  55. official FSF version, as appropriate.
  56.  
  57.    Therefore, `egcs' versions sometimes have multiple listings to help
  58. clarify how they differ from other versions, though this can make
  59. getting a complete picture of what a particular `egcs' version contains
  60. somewhat more difficult.
  61.  
  62.    For information on bugs in the GCC-2.95 version of `g77', see *Note
  63. Known Bugs In GNU Fortran: Known Bugs..
  64.  
  65.    The following information was last updated on 1999-07-08:
  66.  
  67. In 0.5.25, `GCC' 2.95 (`EGCS' 1.2) versus `EGCS' 1.1.2:
  68. =======================================================
  69.  
  70.    * The new `-fbounds-check' option causes `g77' to compile run-time
  71.      bounds checks of array subscripts, as well as of substring start
  72.      and end points.
  73.  
  74.    * `libg2c' now supports building as multilibbed library, which
  75.      provides better support for systems that require options such as
  76.      `-mieee' to work properly.
  77.  
  78.    * Source file names with the suffixes `.FOR' and `.FPP' now are
  79.      recognized by `g77' as if they ended in `.for' and `.fpp',
  80.      respectively.
  81.  
  82.    * The order of arguments to the *subroutine* forms of the `CTime',
  83.      `DTime', `ETime', and `TtyNam' intrinsics has been swapped.  The
  84.      argument serving as the returned value for the corresponding
  85.      function forms now is the *second* argument, making these
  86.      consistent with the other subroutine forms of `libU77' intrinsics.
  87.  
  88.    * `g77' now warns about a reference to an intrinsic that has an
  89.      interface that is not Year 2000 (Y2K) compliant.  Also, `libg2c'
  90.      has been changed to increase the likelihood of catching references
  91.      to the implementations of these intrinsics using the `EXTERNAL'
  92.      mechanism (which would avoid the new warnings).
  93.  
  94.      *Note Year 2000 (Y2K) Problems::, for more information.
  95.  
  96.    * `-fno-emulate-complex' is now the default option.  This should
  97.      result in improved performance of code that uses the `COMPLEX'
  98.      data type.
  99.  
  100.    * The `-malign-double' option now reliably aligns *all*
  101.      double-precision variables and arrays on Intel x86 targets.
  102.  
  103.    * `g77' no longer generates code to maintain `errno', a C-language
  104.      concept, when performing operations such as the `SqRt' intrinsic.
  105.  
  106.    * Support for the `-fugly' option has been removed.
  107.  
  108. In 0.5.24 versus 0.5.23:
  109. ========================
  110.  
  111.    There is no `g77' version 0.5.24 at this time, or planned.  0.5.24
  112. is the version number designated for bug fixes and, perhaps, some new
  113. features added, to 0.5.23.  Version 0.5.23 requires `gcc' 2.8.1, as
  114. 0.5.24 was planned to require.
  115.  
  116.    Due to `EGCS' becoming `GCC' (which is now an acronym for "GNU
  117. Compiler Collection"), and `EGCS' 1.2 becoming officially designated
  118. `GCC' 2.95, there seems to be no need for an actual 0.5.24 release.
  119.  
  120.    To reduce the confusion already resulting from use of 0.5.24 to
  121. designate `g77' versions within `EGCS' versions 1.0 and 1.1, as well as
  122. in versions of `g77' documentation and notices during that period,
  123. "mainline" `g77' version numbering resumes at 0.5.25 with `GCC' 2.95
  124. (`EGCS' 1.2), skipping over 0.5.24 as a placeholder version number.
  125.  
  126.    To repeat, there is no `g77' 0.5.24, but there is now a 0.5.25.
  127. Please remain calm and return to your keypunch units.
  128.  
  129. In `EGCS' 1.1.2 versus `EGCS' 1.1.1:
  130. ====================================
  131.  
  132. In `EGCS' 1.1.1 versus `EGCS' 1.1:
  133. ==================================
  134.  
  135. In `EGCS' 1.1 versus `EGCS' 1.0.3:
  136. ==================================
  137.  
  138.    * Support `FORMAT(I<EXPR>)' when EXPR is a compile-time constant
  139.      `INTEGER' expression.
  140.  
  141.    * Fix `g77' `-g' option so procedures that use `ENTRY' can be
  142.      stepped through, line by line, in `gdb'.
  143.  
  144.    * Allow any `REAL' argument to intrinsics `Second' and `CPU_Time'.
  145.  
  146.    * Use `tempnam', if available, to open scratch files (as in
  147.      `OPEN(STATUS='SCRATCH')') so that the `TMPDIR' environment
  148.      variable, if present, is used.
  149.  
  150.    * `g77''s version of `libf2c' separates out the setting of global
  151.      state (such as command-line arguments and signal handling) from
  152.      `main.o' into distinct, new library archive members.
  153.  
  154.      This should make it easier to write portable applications that
  155.      have their own (non-Fortran) `main()' routine properly set up the
  156.      `libf2c' environment, even when `libf2c' (now `libg2c') is a
  157.      shared library.
  158.  
  159.    * The `g77' command now expects the run-time library to be named
  160.      `libg2c.a' instead of `libf2c.a', to ensure that a version other
  161.      than the one built and installed as part of the same `g77' version
  162.      is picked up.
  163.  
  164.    * Some diagnostics have been changed from warnings to errors, to
  165.      prevent inadvertent use of the resulting, probably buggy, programs.
  166.      These mostly include diagnostics about use of unsupported features
  167.      in the `OPEN', `INQUIRE', `READ', and `WRITE' statements, and
  168.      about truncations of various sorts of constants.
  169.  
  170. In `EGCS' 1.1 versus `g77' 0.5.23:
  171. ==================================
  172.  
  173.    * `g77' now treats `%LOC(EXPR)' and `LOC(EXPR)' as "ordinary"
  174.      expressions when they are used as arguments in procedure calls.
  175.      This change applies only to global (filewide) analysis, making it
  176.      consistent with how `g77' actually generates code for these cases.
  177.  
  178.      Previously, `g77' treated these expressions as denoting special
  179.      "pointer" arguments for the purposes of filewide analysis.
  180.  
  181.    * Align static double-precision variables and arrays on Intel x86
  182.      targets regardless of whether `-malign-double' is specified.
  183.  
  184.      Generally, this affects only local variables and arrays having the
  185.      `SAVE' attribute or given initial values via `DATA'.
  186.  
  187.    * The `g77' driver now ensures that `-lg2c' is specified in the link
  188.      phase prior to any occurrence of `-lm'.  This prevents
  189.      accidentally linking to a routine in the SunOS4 `-lm' library when
  190.      the generated code wants to link to the one in `libf2c' (`libg2c').
  191.  
  192.    * `g77' emits more debugging information when `-g' is used.
  193.  
  194.      This new information allows, for example, `which __g77_length_a'
  195.      to be used in `gdb' to determine the type of the phantom length
  196.      argument supplied with `CHARACTER' variables.
  197.  
  198.      This information pertains to internally-generated type, variable,
  199.      and other information, not to the longstanding deficiencies
  200.      vis-a-vis `COMMON' and `EQUIVALENCE'.
  201.  
  202.    * The F90 `Date_and_Time' intrinsic now is supported.
  203.  
  204.    * The F90 `System_Clock' intrinsic allows the optional arguments
  205.      (except for the `Count' argument) to be omitted.
  206.  
  207. In 0.5.23 versus 0.5.22:
  208. ========================
  209.  
  210.    * This release contains several regressions against version 0.5.22
  211.      of `g77', due to using the "vanilla" `gcc' back end instead of
  212.      patching it to fix a few bugs and improve performance in a few
  213.      cases.
  214.  
  215.      Features that have been dropped from this version of `g77' due to
  216.      their being implemented via `g77'-specific patches to the `gcc'
  217.      back end in previous releases include:
  218.  
  219.         - Support for `__restrict__' keyword, the options
  220.           `-fargument-alias', `-fargument-noalias', and
  221.           `-fargument-noalias-global', and the corresponding
  222.           alias-analysis code.
  223.  
  224.           (`egcs' has the alias-analysis code, but not the
  225.           `__restrict__' keyword.  `egcs' `g77' users benefit from the
  226.           alias-analysis code despite the lack of the `__restrict__'
  227.           keyword, which is a C-language construct.)
  228.  
  229.         - Support for the GNU compiler options `-fmove-all-movables',
  230.           `-freduce-all-givs', and `-frerun-loop-opt'.
  231.  
  232.           (`egcs' supports these options.  `g77' users of `egcs'
  233.           benefit from them even if they are not explicitly specified,
  234.           because the defaults are optimized for `g77' users.)
  235.  
  236.         - Support for the `-W' option warning about integer division by
  237.           zero.
  238.  
  239.         - The Intel x86-specific option `-malign-double' applying to
  240.           stack-allocated data as well as statically-allocate data.
  241.  
  242.    * Support `gcc' version 2.8, and remove support for prior versions
  243.      of `gcc'.
  244.  
  245.    * Remove support for the `--driver' option, as `g77' now does all
  246.      the driving, just like `gcc'.
  247.  
  248.    * The `g77' command now expects the run-time library to be named
  249.      `libg2c.a' instead of `libf2c.a', to ensure that a version other
  250.      than the one built and installed as part of the same `g77' version
  251.      is picked up.
  252.  
  253.    * `g77''s version of `libf2c' separates out the setting of global
  254.      state (such as command-line arguments and signal handling) from
  255.      `main.o' into distinct, new library archive members.
  256.  
  257.      This should make it easier to write portable applications that
  258.      have their own (non-Fortran) `main()' routine properly set up the
  259.      `libf2c' environment, even when `libf2c' (now `libg2c') is a
  260.      shared library.
  261.  
  262.    * Some diagnostics have been changed from warnings to errors, to
  263.      prevent inadvertent use of the resulting, probably buggy, programs.
  264.      These mostly include diagnostics about use of unsupported features
  265.      in the `OPEN', `INQUIRE', `READ', and `WRITE' statements, and
  266.      about truncations of various sorts of constants.
  267.  
  268. In 0.5.22 versus 0.5.21:
  269. ========================
  270.  
  271.    * Fix `Signal' intrinsic so it offers portable support for 64-bit
  272.      systems (such as Digital Alphas running GNU/Linux).
  273.  
  274.    * Support `FORMAT(I<EXPR>)' when EXPR is a compile-time constant
  275.      `INTEGER' expression.
  276.  
  277.    * Fix `g77' `-g' option so procedures that use `ENTRY' can be
  278.      stepped through, line by line, in `gdb'.
  279.  
  280.    * Allow any `REAL' argument to intrinsics `Second' and `CPU_Time'.
  281.  
  282.    * Allow any numeric argument to intrinsics `Int2' and `Int8'.
  283.  
  284.    * Use `tempnam', if available, to open scratch files (as in
  285.      `OPEN(STATUS='SCRATCH')') so that the `TMPDIR' environment
  286.      variable, if present, is used.
  287.  
  288.    * Rename the `gcc' keyword `restrict' to `__restrict__', to avoid
  289.      rejecting valid, existing, C programs.  Support for `restrict' is
  290.      now more like support for `complex'.
  291.  
  292.    * Fix `-fugly-comma' to affect invocations of only external
  293.      procedures.  Restore rejection of gratuitous trailing omitted
  294.      arguments to intrinsics, as in `I=MAX(3,4,,)'.
  295.  
  296.    * Fix compiler so it accepts `-fgnu-intrinsics-*' and
  297.      `-fbadu77-intrinsics-*' options.
  298.  
  299. In `EGCS' 1.0.2 versus `EGCS' 1.0.1:
  300. ====================================
  301.  
  302.    * Fix compiler so it accepts `-fgnu-intrinsics-*' and
  303.      `-fbadu77-intrinsics-*' options.
  304.  
  305. In `EGCS' 1.0.1 versus `EGCS' 1.0:
  306. ==================================
  307.  
  308. In `EGCS' 1.0 versus `g77' 0.5.21:
  309. ==================================
  310.  
  311.    * Version 1.0 of `egcs' contains several regressions against version
  312.      0.5.21 of `g77', due to using the "vanilla" `gcc' back end instead
  313.      of patching it to fix a few bugs and improve performance in a few
  314.      cases.
  315.  
  316.      Features that have been dropped from this version of `g77' due to
  317.      their being implemented via `g77'-specific patches to the `gcc'
  318.      back end in previous releases include:
  319.  
  320.         - Support for the C-language `restrict' keyword.
  321.  
  322.         - Support for the `-W' option warning about integer division by
  323.           zero.
  324.  
  325.         - The Intel x86-specific option `-malign-double' applying to
  326.           stack-allocated data as well as statically-allocate data.
  327.  
  328.    * Remove support for the `--driver' option, as `g77' now does all
  329.      the driving, just like `gcc'.
  330.  
  331.    * Allow any numeric argument to intrinsics `Int2' and `Int8'.
  332.  
  333. In 0.5.21:
  334. ==========
  335.  
  336. 136. When the `-W' option is specified, `gcc', `g77', and other GNU
  337.      compilers that incorporate the `gcc' back end as modified by
  338.      `g77', issue a warning about integer division by constant zero.
  339.  
  340.    * New option `-Wno-globals' disables warnings about "suspicious" use
  341.      of a name both as a global name and as the implicit name of an
  342.      intrinsic, and warnings about disagreements over the number or
  343.      natures of arguments passed to global procedures, or the natures
  344.      of the procedures themselves.
  345.  
  346.      The default is to issue such warnings, which are new as of this
  347.      version of `g77'.
  348.  
  349.    * New option `-fno-globals' disables diagnostics about potentially
  350.      fatal disagreements analysis problems, such as disagreements over
  351.      the number or natures of arguments passed to global procedures, or
  352.      the natures of those procedures themselves.
  353.  
  354.      The default is to issue such diagnostics and flag the compilation
  355.      as unsuccessful.  With this option, the diagnostics are issued as
  356.      warnings, or, if `-Wno-globals' is specified, are not issued at
  357.      all.
  358.  
  359.      This option also disables inlining of global procedures, to avoid
  360.      compiler crashes resulting from coding errors that these
  361.      diagnostics normally would identify.
  362.  
  363.    * Fix `libU77' routines that accept file and other names to strip
  364.      trailing blanks from them, for consistency with other
  365.      implementations.  Blanks may be forcibly appended to such names by
  366.      appending a single null character (`CHAR(0)') to the significant
  367.      trailing blanks.
  368.  
  369.    * Fix `CHMOD' intrinsic to work with file names that have embedded
  370.      blanks, commas, and so on.
  371.  
  372.    * Fix `SIGNAL' intrinsic so it accepts an optional third `Status'
  373.      argument.
  374.  
  375.    * Make many changes to `libU77' intrinsics to support existing code
  376.      more directly.
  377.  
  378.      Such changes include allowing both subroutine and function forms
  379.      of many routines, changing `MCLOCK()' and `TIME()' to return
  380.      `INTEGER(KIND=1)' values, introducing `MCLOCK8()' and `TIME8()' to
  381.      return `INTEGER(KIND=2)' values, and placing functions that are
  382.      intended to perform side effects in a new intrinsic group,
  383.      `badu77'.
  384.  
  385.    * Add options `-fbadu77-intrinsics-delete',
  386.      `-fbadu77-intrinsics-hide', and so on.
  387.  
  388.    * Add `INT2' and `INT8' intrinsics.
  389.  
  390.    * Add `CPU_TIME' intrinsic.
  391.  
  392.    * Add `ALARM' intrinsic.
  393.  
  394.    * `CTIME' intrinsic now accepts any `INTEGER' argument, not just
  395.      `INTEGER(KIND=2)'.
  396.  
  397.    * `g77' driver now prints version information (such as produced by
  398.      `g77 -v') to `stderr' instead of `stdout'.
  399.  
  400.    * The `.r' suffix now designates a Ratfor source file, to be
  401.      preprocessed via the `ratfor' command, available separately.
  402.  
  403. In 0.5.20:
  404. ==========
  405.  
  406.    * The `-fno-typeless-boz' option is now the default.
  407.  
  408.      This option specifies that non-decimal-radix constants using the
  409.      prefixed-radix form (such as `Z'1234'') are to be interpreted as
  410.      `INTEGER(KIND=1)' constants.  Specify `-ftypeless-boz' to cause
  411.      such constants to be interpreted as typeless.
  412.  
  413.      (Version 0.5.19 introduced `-fno-typeless-boz' and its inverse.)
  414.  
  415.      *Note Options Controlling Fortran Dialect: Fortran Dialect Options,
  416.      for information on the `-ftypeless-boz' option.
  417.  
  418.    * Options `-ff90-intrinsics-enable' and `-fvxt-intrinsics-enable'
  419.      now are the defaults.
  420.  
  421.      Some programs might use names that clash with intrinsic names
  422.      defined (and now enabled) by these options or by the new `libU77'
  423.      intrinsics.  Users of such programs might need to compile them
  424.      differently (using, for example, `-ff90-intrinsics-disable') or,
  425.      better yet, insert appropriate `EXTERNAL' statements specifying
  426.      that these names are not intended to be names of intrinsics.
  427.  
  428.    * The `ALWAYS_FLUSH' macro is no longer defined when building
  429.      `libf2c', which should result in improved I/O performance,
  430.      especially over NFS.
  431.  
  432.      *Note:* If you have code that depends on the behavior of `libf2c'
  433.      when built with `ALWAYS_FLUSH' defined, you will have to modify
  434.      `libf2c' accordingly before building it from this and future
  435.      versions of `g77'.
  436.  
  437.      *Note Output Assumed To Flush::, for more information.
  438.  
  439.    * Dave Love's implementation of `libU77' has been added to the
  440.      version of `libf2c' distributed with and built as part of `g77'.
  441.      `g77' now knows about the routines in this library as intrinsics.
  442.  
  443.    * New option `-fvxt' specifies that the source file is written in
  444.      VXT Fortran, instead of GNU Fortran.
  445.  
  446.      *Note VXT Fortran::, for more information on the constructs
  447.      recognized when the `-fvxt' option is specified.
  448.  
  449.    * The `-fvxt-not-f90' option has been deleted, along with its
  450.      inverse, `-ff90-not-vxt'.
  451.  
  452.      If you used one of these deleted options, you should re-read the
  453.      pertinent documentation to determine which options, if any, are
  454.      appropriate for compiling your code with this version of `g77'.
  455.  
  456.      *Note Other Dialects::, for more information.
  457.  
  458.    * The `-fugly' option now issues a warning, as it likely will be
  459.      removed in a future version.
  460.  
  461.      (Enabling all the `-fugly-*' options is unlikely to be feasible,
  462.      or sensible, in the future, so users should learn to specify only
  463.      those `-fugly-*' options they really need for a particular source
  464.      file.)
  465.  
  466.    * The `-fugly-assumed' option, introduced in version 0.5.19, has
  467.      been changed to better accommodate old and new code.
  468.  
  469.      *Note Ugly Assumed-Size Arrays::, for more information.
  470.  
  471.    * Related to supporting Alpha (AXP) machines, the `LOC()' intrinsic
  472.      and `%LOC()' construct now return values of `INTEGER(KIND=0)' type,
  473.      as defined by the GNU Fortran language.
  474.  
  475.      This type is wide enough (holds the same number of bits) as the
  476.      character-pointer type on the machine.
  477.  
  478.      On most machines, this won't make a difference, whereas, on Alphas
  479.      and other systems with 64-bit pointers, the `INTEGER(KIND=0)' type
  480.      is equivalent to `INTEGER(KIND=2)' (often referred to as
  481.      `INTEGER*8') instead of the more common `INTEGER(KIND=1)' (often
  482.      referred to as `INTEGER*4').
  483.  
  484.    * Emulate `COMPLEX' arithmetic in the `g77' front end, to avoid bugs
  485.      in `complex' support in the `gcc' back end.  New option
  486.      `-fno-emulate-complex' causes `g77' to revert the 0.5.19 behavior.
  487.  
  488.    * Dummy arguments are no longer assumed to potentially alias
  489.      (overlap) other dummy arguments or `COMMON' areas when any of
  490.      these are defined (assigned to) by Fortran code.
  491.  
  492.      This can result in faster and/or smaller programs when compiling
  493.      with optimization enabled, though on some systems this effect is
  494.      observed only when `-fforce-addr' also is specified.
  495.  
  496.      New options `-falias-check', `-fargument-alias',
  497.      `-fargument-noalias', and `-fno-argument-noalias-global' control
  498.      the way `g77' handles potential aliasing.
  499.  
  500.      *Note Aliasing Assumed To Work::, for detailed information on why
  501.      the new defaults might result in some programs no longer working
  502.      the way they did when compiled by previous versions of `g77'.
  503.  
  504.    * New option `-fugly-assign' specifies that the same memory
  505.      locations are to be used to hold the values assigned by both
  506.      statements `I = 3' and `ASSIGN 10 TO I', for example.  (Normally,
  507.      `g77' uses a separate memory location to hold assigned statement
  508.      labels.)
  509.  
  510.      *Note Ugly Assigned Labels::, for more information.
  511.  
  512.    * `FORMAT' and `ENTRY' statements now are allowed to precede
  513.      `IMPLICIT NONE' statements.
  514.  
  515.    * Enable full support of `INTEGER(KIND=2)' (often referred to as
  516.      `INTEGER*8') available in `libf2c' and `f2c.h' so that `f2c' users
  517.      may make full use of its features via the `g77' version of `f2c.h'
  518.      and the `INTEGER(KIND=2)' support routines in the `g77' version of
  519.      `libf2c'.
  520.  
  521.    * Improve `g77' driver and `libf2c' so that `g77 -v' yields version
  522.      information on the library.
  523.  
  524.    * The `SNGL' and `FLOAT' intrinsics now are specific intrinsics,
  525.      instead of synonyms for the generic intrinsic `REAL'.
  526.  
  527.    * New intrinsics have been added.  These are `REALPART', `IMAGPART',
  528.      `COMPLEX', `LONG', and `SHORT'.
  529.  
  530.    * A new group of intrinsics, `gnu', has been added to contain the
  531.      new `REALPART', `IMAGPART', and `COMPLEX' intrinsics.  An old
  532.      group, `dcp', has been removed.
  533.  
  534.    * Complain about industry-wide ambiguous references `REAL(EXPR)' and
  535.      `AIMAG(EXPR)', where EXPR is `DOUBLE COMPLEX' (or any complex type
  536.      other than `COMPLEX'), unless `-ff90' option specifies Fortran 90
  537.      interpretation or new `-fugly-complex' option, in conjunction with
  538.      `-fnot-f90', specifies `f2c' interpretation.
  539.  
  540. In previous versions:
  541. =====================
  542.  
  543.    Information on previous versions is archived in
  544. `egcs/gcc/f/news.texi' following the test of the `DOC-OLDNEWS' macro.
  545.  
  546. 
  547. File: g77.info,  Node: Language,  Next: Compiler,  Prev: Changes,  Up: Top
  548.  
  549. The GNU Fortran Language
  550. ************************
  551.  
  552.    GNU Fortran supports a variety of extensions to, and dialects of,
  553. the Fortran language.  Its primary base is the ANSI FORTRAN 77
  554. standard, currently available on the network at
  555. `http://www.fortran.com/fortran/F77_std/rjcnf0001.html' or as
  556. monolithic text at
  557. `http://www.fortran.com/fortran/F77_std/f77_std.html'.  It offers some
  558. extensions that are popular among users of UNIX `f77' and `f2c'
  559. compilers, some that are popular among users of other compilers (such
  560. as Digital products), some that are popular among users of the newer
  561. Fortran 90 standard, and some that are introduced by GNU Fortran.
  562.  
  563.    (If you need a text on Fortran, a few freely available electronic
  564. references have pointers from `http://www.fortran.com/fortran/Books/'.
  565. There is a `cooperative net project', `User Notes on Fortran
  566. Programming' at `ftp://vms.huji.ac.il/fortran/' and mirrors elsewhere;
  567. some of this material might not apply specifically to `g77'.)
  568.  
  569.    Part of what defines a particular implementation of a Fortran
  570. system, such as `g77', is the particular characteristics of how it
  571. supports types, constants, and so on.  Much of this is left up to the
  572. implementation by the various Fortran standards and accepted practice
  573. in the industry.
  574.  
  575.    The GNU Fortran *language* is described below.  Much of the material
  576. is organized along the same lines as the ANSI FORTRAN 77 standard
  577. itself.
  578.  
  579.    *Note Other Dialects::, for information on features `g77' supports
  580. that are not part of the GNU Fortran language.
  581.  
  582.    *Note*: This portion of the documentation definitely needs a lot of
  583. work!
  584.  
  585. * Menu:
  586.  
  587. Relationship to the ANSI FORTRAN 77 standard:
  588. * Direction of Language Development::  Where GNU Fortran is headed.
  589. * Standard Support::  Degree of support for the standard.
  590.  
  591. Extensions to the ANSI FORTRAN 77 standard:
  592. * Conformance::
  593. * Notation Used::
  594. * Terms and Concepts::
  595. * Characters Lines Sequence::
  596. * Data Types and Constants::
  597. * Expressions::
  598. * Specification Statements::
  599. * Control Statements::
  600. * Functions and Subroutines::
  601. * Scope and Classes of Names::
  602. * I/O::
  603. * Fortran 90 Features::
  604.  
  605. 
  606. File: g77.info,  Node: Direction of Language Development,  Next: Standard Support,  Up: Language
  607.  
  608. Direction of Language Development
  609. =================================
  610.  
  611.    The purpose of the following description of the GNU Fortran language
  612. is to promote wide portability of GNU Fortran programs.
  613.  
  614.    GNU Fortran is an evolving language, due to the fact that `g77'
  615. itself is in beta test.  Some current features of the language might
  616. later be redefined as dialects of Fortran supported by `g77' when
  617. better ways to express these features are added to `g77', for example.
  618. Such features would still be supported by `g77', but would be available
  619. only when one or more command-line options were used.
  620.  
  621.    The GNU Fortran *language* is distinct from the GNU Fortran
  622. *compilation system* (`g77').
  623.  
  624.    For example, `g77' supports various dialects of Fortran--in a sense,
  625. these are languages other than GNU Fortran--though its primary purpose
  626. is to support the GNU Fortran language, which also is described in its
  627. documentation and by its implementation.
  628.  
  629.    On the other hand, non-GNU compilers might offer support for the GNU
  630. Fortran language, and are encouraged to do so.
  631.  
  632.    Currently, the GNU Fortran language is a fairly fuzzy object.  It
  633. represents something of a cross between what `g77' accepts when
  634. compiling using the prevailing defaults and what this document
  635. describes as being part of the language.
  636.  
  637.    Future versions of `g77' are expected to clarify the definition of
  638. the language in the documentation.  Often, this will mean adding new
  639. features to the language, in the form of both new documentation and new
  640. support in `g77'.  However, it might occasionally mean removing a
  641. feature from the language itself to "dialect" status.  In such a case,
  642. the documentation would be adjusted to reflect the change, and `g77'
  643. itself would likely be changed to require one or more command-line
  644. options to continue supporting the feature.
  645.  
  646.    The development of the GNU Fortran language is intended to strike a
  647. balance between:
  648.  
  649.    * Serving as a mostly-upwards-compatible language from the de facto
  650.      UNIX Fortran dialect as supported by `f77'.
  651.  
  652.    * Offering new, well-designed language features.  Attributes of such
  653.      features include not making existing code any harder to read (for
  654.      those who might be unaware that the new features are not in use)
  655.      and not making state-of-the-art compilers take longer to issue
  656.      diagnostics, among others.
  657.  
  658.    * Supporting existing, well-written code without gratuitously
  659.      rejecting non-standard constructs, regardless of the origin of the
  660.      code (its dialect).
  661.  
  662.    * Offering default behavior and command-line options to reduce and,
  663.      where reasonable, eliminate the need for programmers to make any
  664.      modifications to code that already works in existing production
  665.      environments.
  666.  
  667.    * Diagnosing constructs that have different meanings in different
  668.      systems, languages, and dialects, while offering clear, less
  669.      ambiguous ways to express each of the different meanings so
  670.      programmers can change their code appropriately.
  671.  
  672.    One of the biggest practical challenges for the developers of the
  673. GNU Fortran language is meeting the sometimes contradictory demands of
  674. the above items.
  675.  
  676.    For example, a feature might be widely used in one popular
  677. environment, but the exact same code that utilizes that feature might
  678. not work as expected--perhaps it might mean something entirely
  679. different--in another popular environment.
  680.  
  681.    Traditionally, Fortran compilers--even portable ones--have solved
  682. this problem by simply offering the appropriate feature to users of the
  683. respective systems.  This approach treats users of various Fortran
  684. systems and dialects as remote "islands", or camps, of programmers, and
  685. assume that these camps rarely come into contact with each other (or,
  686. especially, with each other's code).
  687.  
  688.    Project GNU takes a radically different approach to software and
  689. language design, in that it assumes that users of GNU software do not
  690. necessarily care what kind of underlying system they are using,
  691. regardless of whether they are using software (at the user-interface
  692. level) or writing it (for example, writing Fortran or C code).
  693.  
  694.    As such, GNU users rarely need consider just what kind of underlying
  695. hardware (or, in many cases, operating system) they are using at any
  696. particular time.  They can use and write software designed for a
  697. general-purpose, widely portable, heterogenous environment--the GNU
  698. environment.
  699.  
  700.    In line with this philosophy, GNU Fortran must evolve into a product
  701. that is widely ported and portable not only in the sense that it can be
  702. successfully built, installed, and run by users, but in the larger
  703. sense that its users can use it in the same way, and expect largely the
  704. same behaviors from it, regardless of the kind of system they are using
  705. at any particular time.
  706.  
  707.    This approach constrains the solutions `g77' can use to resolve
  708. conflicts between various camps of Fortran users.  If these two camps
  709. disagree about what a particular construct should mean, `g77' cannot
  710. simply be changed to treat that particular construct as having one
  711. meaning without comment (such as a warning), lest the users expecting
  712. it to have the other meaning are unpleasantly surprised that their code
  713. misbehaves when executed.
  714.  
  715.    The use of the ASCII backslash character in character constants is
  716. an excellent (and still somewhat unresolved) example of this kind of
  717. controversy.  *Note Backslash in Constants::.  Other examples are
  718. likely to arise in the future, as `g77' developers strive to improve
  719. its ability to accept an ever-wider variety of existing Fortran code
  720. without requiring significant modifications to said code.
  721.  
  722.    Development of GNU Fortran is further constrained by the desire to
  723. avoid requiring programmers to change their code.  This is important
  724. because it allows programmers, administrators, and others to more
  725. faithfully evaluate and validate `g77' (as an overall product and as
  726. new versions are distributed) without having to support multiple
  727. versions of their programs so that they continue to work the same way
  728. on their existing systems (non-GNU perhaps, but possibly also earlier
  729. versions of `g77').
  730.  
  731. 
  732. File: g77.info,  Node: Standard Support,  Next: Conformance,  Prev: Direction of Language Development,  Up: Language
  733.  
  734. ANSI FORTRAN 77 Standard Support
  735. ================================
  736.  
  737.    GNU Fortran supports ANSI FORTRAN 77 with the following caveats.  In
  738. summary, the only ANSI FORTRAN 77 features `g77' doesn't support are
  739. those that are probably rarely used in actual code, some of which are
  740. explicitly disallowed by the Fortran 90 standard.
  741.  
  742. * Menu:
  743.  
  744. * No Passing External Assumed-length::  CHAR*(*) CFUNC restriction.
  745. * No Passing Dummy Assumed-length::     CHAR*(*) CFUNC restriction.
  746. * No Pathological Implied-DO::          No `((..., I=...), I=...)'.
  747. * No Useless Implied-DO::               No `(A, I=1, 1)'.
  748.  
  749. 
  750. File: g77.info,  Node: No Passing External Assumed-length,  Next: No Passing Dummy Assumed-length,  Up: Standard Support
  751.  
  752. No Passing External Assumed-length
  753. ----------------------------------
  754.  
  755.    `g77' disallows passing of an external procedure as an actual
  756. argument if the procedure's type is declared `CHARACTER*(*)'.  For
  757. example:
  758.  
  759.      CHARACTER*(*) CFUNC
  760.      EXTERNAL CFUNC
  761.      CALL FOO(CFUNC)
  762.      END
  763.  
  764. It isn't clear whether the standard considers this conforming.
  765.  
  766. 
  767. File: g77.info,  Node: No Passing Dummy Assumed-length,  Next: No Pathological Implied-DO,  Prev: No Passing External Assumed-length,  Up: Standard Support
  768.  
  769. No Passing Dummy Assumed-length
  770. -------------------------------
  771.  
  772.    `g77' disallows passing of a dummy procedure as an actual argument
  773. if the procedure's type is declared `CHARACTER*(*)'.
  774.  
  775.      SUBROUTINE BAR(CFUNC)
  776.      CHARACTER*(*) CFUNC
  777.      EXTERNAL CFUNC
  778.      CALL FOO(CFUNC)
  779.      END
  780.  
  781. It isn't clear whether the standard considers this conforming.
  782.  
  783. 
  784. File: g77.info,  Node: No Pathological Implied-DO,  Next: No Useless Implied-DO,  Prev: No Passing Dummy Assumed-length,  Up: Standard Support
  785.  
  786. No Pathological Implied-DO
  787. --------------------------
  788.  
  789.    The `DO' variable for an implied-`DO' construct in a `DATA'
  790. statement may not be used as the `DO' variable for an outer
  791. implied-`DO' construct.  For example, this fragment is disallowed by
  792. `g77':
  793.  
  794.      DATA ((A(I, I), I= 1, 10), I= 1, 10) /.../
  795.  
  796. This also is disallowed by Fortran 90, as it offers no additional
  797. capabilities and would have a variety of possible meanings.
  798.  
  799.    Note that it is *very* unlikely that any production Fortran code
  800. tries to use this unsupported construct.
  801.  
  802. 
  803. File: g77.info,  Node: No Useless Implied-DO,  Prev: No Pathological Implied-DO,  Up: Standard Support
  804.  
  805. No Useless Implied-DO
  806. ---------------------
  807.  
  808.    An array element initializer in an implied-`DO' construct in a
  809. `DATA' statement must contain at least one reference to the `DO'
  810. variables of each outer implied-`DO' construct.  For example, this
  811. fragment is disallowed by `g77':
  812.  
  813.      DATA (A, I= 1, 1) /1./
  814.  
  815. This also is disallowed by Fortran 90, as FORTRAN 77's more permissive
  816. requirements offer no additional capabilities.  However, `g77' doesn't
  817. necessarily diagnose all cases where this requirement is not met.
  818.  
  819.    Note that it is *very* unlikely that any production Fortran code
  820. tries to use this unsupported construct.
  821.  
  822. 
  823. File: g77.info,  Node: Conformance,  Next: Notation Used,  Prev: Standard Support,  Up: Language
  824.  
  825. Conformance
  826. ===========
  827.  
  828.    (The following information augments or overrides the information in
  829. Section 1.4 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran
  830. language.  Chapter 1 of that document otherwise serves as the basis for
  831. the relevant aspects of GNU Fortran.)
  832.  
  833.    The definition of the GNU Fortran language is akin to that of the
  834. ANSI FORTRAN 77 language in that it does not generally require
  835. conforming implementations to diagnose cases where programs do not
  836. conform to the language.
  837.  
  838.    However, `g77' as a compiler is being developed in a way that is
  839. intended to enable it to diagnose such cases in an easy-to-understand
  840. manner.
  841.  
  842.    A program that conforms to the GNU Fortran language should, when
  843. compiled, linked, and executed using a properly installed `g77' system,
  844. perform as described by the GNU Fortran language definition.  Reasons
  845. for different behavior include, among others:
  846.  
  847.    * Use of resources (memory--heap, stack, and so on; disk space; CPU
  848.      time; etc.) exceeds those of the system.
  849.  
  850.    * Range and/or precision of calculations required by the program
  851.      exceeds that of the system.
  852.  
  853.    * Excessive reliance on behaviors that are system-dependent
  854.      (non-portable Fortran code).
  855.  
  856.    * Bugs in the program.
  857.  
  858.    * Bug in `g77'.
  859.  
  860.    * Bugs in the system.
  861.  
  862.    Despite these "loopholes", the availability of a clear specification
  863. of the language of programs submitted to `g77', as this document is
  864. intended to provide, is considered an important aspect of providing a
  865. robust, clean, predictable Fortran implementation.
  866.  
  867.    The definition of the GNU Fortran language, while having no special
  868. legal status, can therefore be viewed as a sort of contract, or
  869. agreement.  This agreement says, in essence, "if you write a program in
  870. this language, and run it in an environment (such as a `g77' system)
  871. that supports this language, the program should behave in a largely
  872. predictable way".
  873.  
  874. 
  875. File: g77.info,  Node: Notation Used,  Next: Terms and Concepts,  Prev: Conformance,  Up: Language
  876.  
  877. Notation Used in This Chapter
  878. =============================
  879.  
  880.    (The following information augments or overrides the information in
  881. Section 1.5 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran
  882. language.  Chapter 1 of that document otherwise serves as the basis for
  883. the relevant aspects of GNU Fortran.)
  884.  
  885.    In this chapter, "must" denotes a requirement, "may" denotes
  886. permission, and "must not" and "may not" denote prohibition.  Terms
  887. such as "might", "should", and "can" generally add little or nothing in
  888. the way of weight to the GNU Fortran language itself, but are used to
  889. explain or illustrate the language.
  890.  
  891.    For example:
  892.  
  893.      ``The `FROBNITZ' statement must precede all executable
  894.      statements in a program unit, and may not specify any dummy
  895.      arguments.  It may specify local or common variables and arrays.
  896.      Its use should be limited to portions of the program designed to
  897.      be non-portable and system-specific, because it might cause the
  898.      containing program unit to behave quite differently on different
  899.      systems.''
  900.  
  901.    Insofar as the GNU Fortran language is specified, the requirements
  902. and permissions denoted by the above sample statement are limited to
  903. the placement of the statement and the kinds of things it may specify.
  904. The rest of the statement--the content regarding non-portable portions
  905. of the program and the differing behavior of program units containing
  906. the `FROBNITZ' statement--does not pertain the GNU Fortran language
  907. itself.  That content offers advice and warnings about the `FROBNITZ'
  908. statement.
  909.  
  910.    *Remember:* The GNU Fortran language definition specifies both what
  911. constitutes a valid GNU Fortran program and how, given such a program,
  912. a valid GNU Fortran implementation is to interpret that program.
  913.  
  914.    It is *not* incumbent upon a valid GNU Fortran implementation to
  915. behave in any particular way, any consistent way, or any predictable
  916. way when it is asked to interpret input that is *not* a valid GNU
  917. Fortran program.
  918.  
  919.    Such input is said to have "undefined" behavior when interpreted by
  920. a valid GNU Fortran implementation, though an implementation may choose
  921. to specify behaviors for some cases of inputs that are not valid GNU
  922. Fortran programs.
  923.  
  924.    Other notation used herein is that of the GNU texinfo format, which
  925. is used to generate printed hardcopy, on-line hypertext (Info), and
  926. on-line HTML versions, all from a single source document.  This
  927. notation is used as follows:
  928.  
  929.    * Keywords defined by the GNU Fortran language are shown in
  930.      uppercase, as in: `COMMON', `INTEGER', and `BLOCK DATA'.
  931.  
  932.      Note that, in practice, many Fortran programs are written in
  933.      lowercase--uppercase is used in this manual as a means to readily
  934.      distinguish keywords and sample Fortran-related text from the
  935.      prose in this document.
  936.  
  937.    * Portions of actual sample program, input, or output text look like
  938.      this: `Actual program text'.
  939.  
  940.      Generally, uppercase is used for all Fortran-specific and
  941.      Fortran-related text, though this does not always include literal
  942.      text within Fortran code.
  943.  
  944.      For example: `PRINT *, 'My name is Bob''.
  945.  
  946.    * A metasyntactic variable--that is, a name used in this document to
  947.      serve as a placeholder for whatever text is used by the user or
  948.      programmer--appears as shown in the following example:
  949.  
  950.      "The `INTEGER IVAR' statement specifies that IVAR is a variable or
  951.      array of type `INTEGER'."
  952.  
  953.      In the above example, any valid text may be substituted for the
  954.      metasyntactic variable IVAR to make the statement apply to a
  955.      specific instance, as long as the same text is substituted for
  956.      *both* occurrences of IVAR.
  957.  
  958.    * Ellipses ("...") are used to indicate further text that is either
  959.      unimportant or expanded upon further, elsewhere.
  960.  
  961.    * Names of data types are in the style of Fortran 90, in most cases.
  962.  
  963.      *Note Kind Notation::, for information on the relationship between
  964.      Fortran 90 nomenclature (such as `INTEGER(KIND=1)') and the more
  965.      traditional, less portably concise nomenclature (such as
  966.      `INTEGER*4').
  967.  
  968. 
  969. File: g77.info,  Node: Terms and Concepts,  Next: Characters Lines Sequence,  Prev: Notation Used,  Up: Language
  970.  
  971. Fortran Terms and Concepts
  972. ==========================
  973.  
  974.    (The following information augments or overrides the information in
  975. Chapter 2 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran
  976. language.  Chapter 2 of that document otherwise serves as the basis for
  977. the relevant aspects of GNU Fortran.)
  978.  
  979. * Menu:
  980.  
  981. * Syntactic Items::
  982. * Statements Comments Lines::
  983. * Scope of Names and Labels::
  984.  
  985. 
  986. File: g77.info,  Node: Syntactic Items,  Next: Statements Comments Lines,  Up: Terms and Concepts
  987.  
  988. Syntactic Items
  989. ---------------
  990.  
  991.    (Corresponds to Section 2.2 of ANSI X3.9-1978 FORTRAN 77.)
  992.  
  993.    In GNU Fortran, a symbolic name is at least one character long, and
  994. has no arbitrary upper limit on length.  However, names of entities
  995. requiring external linkage (such as external functions, external
  996. subroutines, and `COMMON' areas) might be restricted to some arbitrary
  997. length by the system.  Such a restriction is no more constrained than
  998. that of one through six characters.
  999.  
  1000.    Underscores (`_') are accepted in symbol names after the first
  1001. character (which must be a letter).
  1002.  
  1003. 
  1004. File: g77.info,  Node: Statements Comments Lines,  Next: Scope of Names and Labels,  Prev: Syntactic Items,  Up: Terms and Concepts
  1005.  
  1006. Statements, Comments, and Lines
  1007. -------------------------------
  1008.  
  1009.    (Corresponds to Section 2.3 of ANSI X3.9-1978 FORTRAN 77.)
  1010.  
  1011.    Use of an exclamation point (`!') to begin a trailing comment (a
  1012. comment that extends to the end of the same source line) is permitted
  1013. under the following conditions:
  1014.  
  1015.    * The exclamation point does not appear in column 6.  Otherwise, it
  1016.      is treated as an indicator of a continuation line.
  1017.  
  1018.    * The exclamation point appears outside a character or Hollerith
  1019.      constant.  Otherwise, the exclamation point is considered part of
  1020.      the constant.
  1021.  
  1022.    * The exclamation point appears to the left of any other possible
  1023.      trailing comment.  That is, a trailing comment may contain
  1024.      exclamation points in their commentary text.
  1025.  
  1026.    Use of a semicolon (`;') as a statement separator is permitted under
  1027. the following conditions:
  1028.  
  1029.    * The semicolon appears outside a character or Hollerith constant.
  1030.      Otherwise, the semicolon is considered part of the constant.
  1031.  
  1032.    * The semicolon appears to the left of a trailing comment.
  1033.      Otherwise, the semicolon is considered part of that comment.
  1034.  
  1035.    * Neither a logical `IF' statement nor a non-construct `WHERE'
  1036.      statement (a Fortran 90 feature) may be followed (in the same,
  1037.      possibly continued, line) by a semicolon used as a statement
  1038.      separator.
  1039.  
  1040.      This restriction avoids the confusion that can result when reading
  1041.      a line such as:
  1042.  
  1043.           IF (VALIDP) CALL FOO; CALL BAR
  1044.  
  1045.      Some readers might think the `CALL BAR' is executed only if
  1046.      `VALIDP' is `.TRUE.', while others might assume its execution is
  1047.      unconditional.
  1048.  
  1049.      (At present, `g77' does not diagnose code that violates this
  1050.      restriction.)
  1051.  
  1052. 
  1053. File: g77.info,  Node: Scope of Names and Labels,  Prev: Statements Comments Lines,  Up: Terms and Concepts
  1054.  
  1055. Scope of Symbolic Names and Statement Labels
  1056. --------------------------------------------
  1057.  
  1058.    (Corresponds to Section 2.9 of ANSI X3.9-1978 FORTRAN 77.)
  1059.  
  1060.    Included in the list of entities that have a scope of a program unit
  1061. are construct names (a Fortran 90 feature).  *Note Construct Names::,
  1062. for more information.
  1063.  
  1064. 
  1065. File: g77.info,  Node: Characters Lines Sequence,  Next: Data Types and Constants,  Prev: Terms and Concepts,  Up: Language
  1066.  
  1067. Characters, Lines, and Execution Sequence
  1068. =========================================
  1069.  
  1070.    (The following information augments or overrides the information in
  1071. Chapter 3 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran
  1072. language.  Chapter 3 of that document otherwise serves as the basis for
  1073. the relevant aspects of GNU Fortran.)
  1074.  
  1075. * Menu:
  1076.  
  1077. * Character Set::
  1078. * Lines::
  1079. * Continuation Line::
  1080. * Statements::
  1081. * Statement Labels::
  1082. * Order::
  1083. * INCLUDE::
  1084. * Cpp-style directives::
  1085.  
  1086. 
  1087. File: g77.info,  Node: Character Set,  Next: Lines,  Up: Characters Lines Sequence
  1088.  
  1089. GNU Fortran Character Set
  1090. -------------------------
  1091.  
  1092.    (Corresponds to Section 3.1 of ANSI X3.9-1978 FORTRAN 77.)
  1093.  
  1094.    Letters include uppercase letters (the twenty-six characters of the
  1095. English alphabet) and lowercase letters (their lowercase equivalent).
  1096. Generally, lowercase letters may be used in place of uppercase letters,
  1097. though in character and Hollerith constants, they are distinct.
  1098.  
  1099.    Special characters include:
  1100.  
  1101.    * Semicolon (`;')
  1102.  
  1103.    * Exclamation point (`!')
  1104.  
  1105.    * Double quote (`"')
  1106.  
  1107.    * Backslash (`\')
  1108.  
  1109.    * Question mark (`?')
  1110.  
  1111.    * Hash mark (`#')
  1112.  
  1113.    * Ampersand (`&')
  1114.  
  1115.    * Percent sign (`%')
  1116.  
  1117.    * Underscore (`_')
  1118.  
  1119.    * Open angle (`<')
  1120.  
  1121.    * Close angle (`>')
  1122.  
  1123.    * The FORTRAN 77 special characters (<SPC>, `=', `+', `-', `*', `/',
  1124.      `(', `)', `,', `.', `$', `'', and `:')
  1125.  
  1126.    Note that this document refers to <SPC> as "space", while X3.9-1978
  1127. FORTRAN 77 refers to it as "blank".
  1128.  
  1129. 
  1130. File: g77.info,  Node: Lines,  Next: Continuation Line,  Prev: Character Set,  Up: Characters Lines Sequence
  1131.  
  1132. Lines
  1133. -----
  1134.  
  1135.    (Corresponds to Section 3.2 of ANSI X3.9-1978 FORTRAN 77.)
  1136.  
  1137.    The way a Fortran compiler views source files depends entirely on the
  1138. implementation choices made for the compiler, since those choices are
  1139. explicitly left to the implementation by the published Fortran
  1140. standards.
  1141.  
  1142.    The GNU Fortran language mandates a view applicable to UNIX-like
  1143. text files--files that are made up of an arbitrary number of lines,
  1144. each with an arbitrary number of characters (sometimes called
  1145. stream-based files).
  1146.  
  1147.    This view does not apply to types of files that are specified as
  1148. having a particular number of characters on every single line (sometimes
  1149. referred to as record-based files).
  1150.  
  1151.    Because a "line in a program unit is a sequence of 72 characters",
  1152. to quote X3.9-1978, the GNU Fortran language specifies that a
  1153. stream-based text file is translated to GNU Fortran lines as follows:
  1154.  
  1155.    * A newline in the file is the character that represents the end of
  1156.      a line of text to the underlying system.  For example, on
  1157.      ASCII-based systems, a newline is the <NL> character, which has
  1158.      ASCII value 10 (decimal).
  1159.  
  1160.    * Each newline in the file serves to end the line of text that
  1161.      precedes it (and that does not contain a newline).
  1162.  
  1163.    * The end-of-file marker (`EOF') also serves to end the line of text
  1164.      that precedes it (and that does not contain a newline).
  1165.  
  1166.    * Any line of text that is shorter than 72 characters is padded to
  1167.      that length with spaces (called "blanks" in the standard).
  1168.  
  1169.    * Any line of text that is longer than 72 characters is truncated to
  1170.      that length, but the truncated remainder must consist entirely of
  1171.      spaces.
  1172.  
  1173.    * Characters other than newline and the GNU Fortran character set
  1174.      are invalid.
  1175.  
  1176.    For the purposes of the remainder of this description of the GNU
  1177. Fortran language, the translation described above has already taken
  1178. place, unless otherwise specified.
  1179.  
  1180.    The result of the above translation is that the source file appears,
  1181. in terms of the remainder of this description of the GNU Fortran
  1182. language, as if it had an arbitrary number of 72-character lines, each
  1183. character being among the GNU Fortran character set.
  1184.  
  1185.    For example, if the source file itself has two newlines in a row,
  1186. the second newline becomes, after the above translation, a single line
  1187. containing 72 spaces.
  1188.  
  1189. 
  1190. File: g77.info,  Node: Continuation Line,  Next: Statements,  Prev: Lines,  Up: Characters Lines Sequence
  1191.  
  1192. Continuation Line
  1193. -----------------
  1194.  
  1195.    (Corresponds to Section 3.2.3 of ANSI X3.9-1978 FORTRAN 77.)
  1196.  
  1197.    A continuation line is any line that both
  1198.  
  1199.    * Contains a continuation character, and
  1200.  
  1201.    * Contains only spaces in columns 1 through 5
  1202.  
  1203.    A continuation character is any character of the GNU Fortran
  1204. character set other than space (<SPC>) or zero (`0') in column 6, or a
  1205. digit (`0' through `9') in column 7 through 72 of a line that has only
  1206. spaces to the left of that digit.
  1207.  
  1208.    The continuation character is ignored as far as the content of the
  1209. statement is concerned.
  1210.  
  1211.    The GNU Fortran language places no limit on the number of
  1212. continuation lines in a statement.  In practice, the limit depends on a
  1213. variety of factors, such as available memory, statement content, and so
  1214. on, but no GNU Fortran system may impose an arbitrary limit.
  1215.  
  1216. 
  1217. File: g77.info,  Node: Statements,  Next: Statement Labels,  Prev: Continuation Line,  Up: Characters Lines Sequence
  1218.  
  1219. Statements
  1220. ----------
  1221.  
  1222.    (Corresponds to Section 3.3 of ANSI X3.9-1978 FORTRAN 77.)
  1223.  
  1224.    Statements may be written using an arbitrary number of continuation
  1225. lines.
  1226.  
  1227.    Statements may be separated using the semicolon (`;'), except that
  1228. the logical `IF' and non-construct `WHERE' statements may not be
  1229. separated from subsequent statements using only a semicolon as
  1230. statement separator.
  1231.  
  1232.    The `END PROGRAM', `END SUBROUTINE', `END FUNCTION', and `END BLOCK
  1233. DATA' statements are alternatives to the `END' statement.  These
  1234. alternatives may be written as normal statements--they are not subject
  1235. to the restrictions of the `END' statement.
  1236.  
  1237.    However, no statement other than `END' may have an initial line that
  1238. appears to be an `END' statement--even `END PROGRAM', for example, must
  1239. not be written as:
  1240.  
  1241.            END
  1242.           &PROGRAM
  1243.  
  1244. 
  1245. File: g77.info,  Node: Statement Labels,  Next: Order,  Prev: Statements,  Up: Characters Lines Sequence
  1246.  
  1247. Statement Labels
  1248. ----------------
  1249.  
  1250.    (Corresponds to Section 3.4 of ANSI X3.9-1978 FORTRAN 77.)
  1251.  
  1252.    A statement separated from its predecessor via a semicolon may be
  1253. labeled as follows:
  1254.  
  1255.    * The semicolon is followed by the label for the statement, which in
  1256.      turn follows the label.
  1257.  
  1258.    * The label must be no more than five digits in length.
  1259.  
  1260.    * The first digit of the label for the statement is not the first
  1261.      non-space character on a line.  Otherwise, that character is
  1262.      treated as a continuation character.
  1263.  
  1264.    A statement may have only one label defined for it.
  1265.  
  1266. 
  1267. File: g77.info,  Node: Order,  Next: INCLUDE,  Prev: Statement Labels,  Up: Characters Lines Sequence
  1268.  
  1269. Order of Statements and Lines
  1270. -----------------------------
  1271.  
  1272.    (Corresponds to Section 3.5 of ANSI X3.9-1978 FORTRAN 77.)
  1273.  
  1274.    Generally, `DATA' statements may precede executable statements.
  1275. However, specification statements pertaining to any entities
  1276. initialized by a `DATA' statement must precede that `DATA' statement.
  1277. For example, after `DATA I/1/', `INTEGER I' is not permitted, but
  1278. `INTEGER J' is permitted.
  1279.  
  1280.    The last line of a program unit may be an `END' statement, or may be:
  1281.  
  1282.    * An `END PROGRAM' statement, if the program unit is a main program.
  1283.  
  1284.    * An `END SUBROUTINE' statement, if the program unit is a subroutine.
  1285.  
  1286.    * An `END FUNCTION' statement, if the program unit is a function.
  1287.  
  1288.    * An `END BLOCK DATA' statement, if the program unit is a block data.
  1289.  
  1290.